package com.tx.constant;

/**
 * @author dengguoxing
 * @date 2019/11/1
 * description
 **/
public enum WsEvent {

    SYSTEM("system"),

    SUB("sub"),

    UNSUB("unsub"),

    SUBED("subed"),

    UNSUBED("unsubed"),

    PUSH("push");

    private String value;

    WsEvent(String value) {
        this.value =  value;
    }

    public String getValue() {
        return value;
    }

    public static WsEvent fromValue(String value) {
        for (WsEvent type : WsEvent.values()) {
            if (type.value.equalsIgnoreCase(value)) {
                return type;
            }
        }
        return null;
    }
}
